import * as THREE from "three";
import {CSS2DObject} from "three/addons/renderers/CSS2DRenderer.js";

function tag(name) {
    var that = this;
    // 创建div元素(作为标签)
    var div = document.createElement('div')
    div.innerHTML = `<div class="tags">${name}</div>`
    div.classList.add('tag')
    //div元素包装为CSS2模型对象CSS2DObject
    var label = new CSS2DObject(div)
    div.style.pointerEvents = 'none'//避免HTML标签遮挡三维场景的鼠标事件
    return label//返回CSS2模型标签
}

export default tag
